package com.lucky.tjs;

import com.dangdang.ddframe.job.api.ElasticJob;
import com.lucky.tjs.config.ElasticJobRegistryCenterConfig;
import com.lucky.tjs.config.EljobPostProcessor;
import com.lucky.tjs.entity.ZkConfigProperties;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author TJS
 * @Description
 * @create 2023/5/12 7:17
 */
@Configuration
@ComponentScan
@EnableConfigurationProperties(ZkConfigProperties.class)
@ConditionalOnClass(ElasticJob.class)
@Import({ElasticJobRegistryCenterConfig.class})
public class ElasticJobAutoConfiguration {

    @Bean
    public EljobPostProcessor postProcessor(){
        return new EljobPostProcessor();
    }
}

